<?php

/**
 * winbinder 패키지 
 * 
 * 
 * @package php.ui.winbinder
 */


/**
 * WBSpinner
 *
 * @package php.ui.winbinder
 */
class WBSpinner extends WBRange { 
	public function __construct($options = array()) { 
		$options['class'] = Spinner;
		$options['group'] = isset($options['group']) ? $options['group'] : true;

		parent::__construct($options);
	}
	
	protected function initCreate() { 
		parent::initCreate();
		
		$style = $this->getOption('style');
		
		// 근처 EditBox 와 자동 매칭 여부 설정 
		if (isset($this->group)) { 
			if ($this->getOption('group')) $style |= WBC_GROUP;
		}
		
		$this->setOption('style', $style);
	}

	// 객체 초기화 
	protected function initComponent() { 
		parent::initComponent();
			
		if (isset($this->range))	$this->setRange($this->getOption('range'));
		if (isset($this->min) || isset($this->max)) $this->setRange(array('min' => intval($this->getOption('min')), 'max' => intval($this->getOption('max'))));
		if (isset($this->tooltip))  $this->setToolTip($this->getOption('tooltip'));
		//if (isset($this->group))	$this->setGroup($this->getOption('group'));
	}

	/**
	 * 최초 설정하는 group 속성이기 때문에 따로 설정할 수가 없음 
	 * 
	 * @param $isGroup
	 * @return unknown_type
	 * @deprecated
	 */
	public function setGroup($isGroup = true) { 
		$this->setStyle(WBC_GROUP, $isGroup);
	}

}

?>
